<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .outter {
            width: 400px;
            height: 400px;

            /* 核心代码 */
            /* 控制内联元素水平居中 */
            text-align: center;

            background-color: coral;
        }

        .inner {
            /* 核心代码 */
            display: inline-block;
            vertical-align: middle;

            width: 200px;
            height: 200px;

            background-color: cornflowerblue;
        }

        /* 核心代码 */
        .help {
            display: inline-block;
            width: 0;
            height: 100%;

            vertical-align: middle;
        }
    </style>
</head>

<body>
    <div class="outter">
        <div class="inner">
            内部盒子
        </div>
        <div class="help"></div>
    </div>
</body>

</html>